﻿<Window x:Class="SsTool.Workflow.Windows.UpdateEventWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="UpdateActivityWindow"
        ShowInTaskbar="False"
        Width="500"
        Height="500"
        SizeToContent="Height"
        WindowStartupLocation="CenterScreen">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <GroupBox Grid.Row="0" Margin="5,5,5,0">
            <GroupBox.Header>
                <StackPanel Orientation="Horizontal" Margin="1">
                    <Image Source="../../Resources/run.png" Margin="0,0,3,0"/>
                    <TextBlock Text="基本信息"/>
                </StackPanel>
            </GroupBox.Header>
            <GroupBox.Content>
                <StackPanel>
                    <Label Content="事件类型"/>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBox Text="{Binding Path=Type.Caption}" Grid.Column="0" IsReadOnly="True" VerticalContentAlignment="Center"/>
                        <Button Grid.Column="1" Name="_ctlBtnSelectEventType" Click="_ctlBtnSelectEventType_Click" Margin="5,0,0,0">
                            <StackPanel Orientation="Horizontal" Margin="1">
                                <Image Source="../../Resources/folder-open.png" Margin="0,0,3,0"/>
                                <TextBlock Text="选择事件类型" VerticalAlignment="Center"/>
                            </StackPanel>
                        </Button>
                    </Grid>
                    <Label Content="名称:" Name="label2"/>
                    <TextBox Text="{Binding Caption}" Name="textBox2"/>
                    <Label Content="排序号"/>
                    <TextBox Text="{Binding Path=OrderIndex,Mode=TwoWay}" Name="_ctlEditOrderIndex"/>
                    <Label Content="目标活动:" Name="label3" />
                    <ComboBox Name="comboBox1" SelectedItem="{Binding ToActivity}">
                        <ComboBox.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Caption}"/>
                            </DataTemplate>
                        </ComboBox.ItemTemplate>
                    </ComboBox>
                </StackPanel>
            </GroupBox.Content>
        </GroupBox>
        <GroupBox Grid.Row="1" Margin="5,5,5,0">
            <GroupBox.Header>
                <StackPanel Orientation="Horizontal" Margin="1">
                    <Image Source="../../Resources/Administrative_Tools.png" Margin="0,0,3,0"/>
                    <TextBlock Text="权限设置"/>
                </StackPanel>
            </GroupBox.Header>
            <GroupBox.Content>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="auto"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <GroupBox Header="视图权限" Grid.Column="0">
                        <DataGrid Name="_ctlGridActivityRights" AutoGenerateColumns="False" IsReadOnly="True">
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="角色Name" Binding="{Binding Path=Role.Name}" Width="*"/>
                                <DataGridTextColumn Header="角色" Binding="{Binding Path=Role.Caption}" Width="*"/>
                            </DataGrid.Columns>
                        </DataGrid>

                    </GroupBox>
                    <StackPanel Grid.Column="1" VerticalAlignment="Center">
                        <Button Name="_ctlBtnAdd"  Click="_ctlBtnAdd_Click" Margin="5,5,5,0">
                            <StackPanel Orientation="Horizontal">
                                <Image Source="../../Resources/Arrow.png" Margin="0,0,3,0"/>
                                <TextBlock Text="添加"/>
                            </StackPanel>
                        </Button>
                        <Button Name="_ctlBtnRemove" Click="_ctlBtnRemove_Click" Margin="5,5,5,5">
                            <StackPanel Orientation="Horizontal">
                                <Image Source="../../Resources/Arrow-back-red.png" Margin="0,0,3,0"/>
                                <TextBlock Text="删除"/>
                            </StackPanel>
                        </Button>
                    </StackPanel>
                    <GroupBox Header="事件权限" Grid.Column="2">
                        <DataGrid Name="_ctlGridRights" AutoGenerateColumns="False" IsReadOnly="True">
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="角色Name" Binding="{Binding Path=Role.Name}"  Width="*"/>
                                <DataGridTextColumn Header="角色" Binding="{Binding Path=Role.Caption}" Width="*"/>
                            </DataGrid.Columns>
                        </DataGrid>
                    </GroupBox>
                </Grid>
            </GroupBox.Content>
        </GroupBox>
        <StackPanel Grid.Row="2" HorizontalAlignment="Center" Orientation="Horizontal">
            <Button Name="button1"  Click="button1_Click" Margin="5,5,0,5">
                <StackPanel Orientation="Horizontal" Margin="1">
                    <Image Source="../../Resources/accept.png" Margin="0,0,3,0"/>
                    <TextBlock Text="保存"/>
                </StackPanel>
            </Button>
            <Button Name="_ctlBtnCancel"  Margin="5,5,5,5">
                <StackPanel Orientation="Horizontal" Margin="1">
                    <Image Source="../../Resources/Cancel.png" Margin="0,0,3,0"/>
                    <TextBlock Text="关闭"/>
                </StackPanel>
            </Button>
        </StackPanel>
    </Grid>
</Window>
